using System.Collections.Generic;
using JlPay.Sdk.Models;

namespace JlPay.Sdk.Models.Marketing
{
    /// <summary>
    /// 商户活动新增请求模型
    /// </summary>
    public class MerchantActivityAddRequest : OrgBaseRequest, IRequestMapper
    {
        /// <summary>
        /// 活动ID
        /// </summary>
        public string? ActId { get; set; }

        /// <summary>
        /// 商户号
        /// </summary>
        public string? MerchNo { get; set; }

        /// <summary>
        /// 终端号列表
        /// </summary>
        public List<string>? TermNos { get; set; }

        /// <summary>
        /// 商户活动开始时间
        /// </summary>
        public string? StartTime { get; set; }

        /// <summary>
        /// 商户活动结束时间
        /// </summary>
        public string? EndTime { get; set; }

        /// <summary>
        /// 商户额度信息
        /// </summary>
        public List<MerchantQuotaInfo>? UpdateQuotas { get; set; }

        /// <summary>
        /// 获取接口路径
        /// </summary>
        /// <returns>接口路径</returns>
        public string Path()
        {
            return "/open/org/bank/act-bridge/act-merch-relation/add";
        }

        /// <summary>
        /// 转换为字典，过滤掉值为null的字段，使用snake_case命名策略
        /// </summary>
        /// <returns>字典对象</returns>
        public Dictionary<string, object> ToMap()
        {
            var result = new Dictionary<string, object>();
            
            if (!string.IsNullOrEmpty(ActId))
                result["act_id"] = ActId;
            
            if (!string.IsNullOrEmpty(MerchNo))
                result["merch_no"] = MerchNo;
            
            if (TermNos != null && TermNos.Count > 0)
                result["term_nos"] = TermNos;
            
            if (!string.IsNullOrEmpty(StartTime))
                result["start_time"] = StartTime;
            
            if (!string.IsNullOrEmpty(EndTime))
                result["end_time"] = EndTime;
            
            if (UpdateQuotas != null && UpdateQuotas.Count > 0)
                result["update_quotas"] = UpdateQuotas;
            
            return result;
        }
    }
} 